

*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------
*
*	Title:		Big Data meets Open Political Science: 
*				An Empirical Assessment of Transparency Standards 2008-2019
*
*	Authors: 	Karin Dyrstad & Jonathon W. Moses
*	Journal: 	European Political Science
*
*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------

ssc install cem
ssc install outreg

clear all
use replicationdata



*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------
*
*				MAIN ANALYSIS
*
*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------



***** Figure 4: BDPS articles published over time, PS and JETS
preserve
collapse (sum) bd pswos jets if bd ==1, by(year)
lab var bd "Total BDPS articles"
lab var ps "In PS journal"
lab var jets "In JETS journal"
tw(connected bd year)(connected ps year)(connected jets year), xlabel(2008(1)2019, angle(45)) ytitle("Number of BDPS articles") scheme(plotplain) xtitle("")
restore



***** Figure 5: Trends in transparency 
bysort year: egen transp_share_bdps = mean(transp) if bd==1
bysort year: egen bdps_n = count(bd) if bd==1
bysort year: egen transp_share_ps = mean(transp) if bd==0
bysort year: egen transp_share_empirical = mean(transp) if bd==0 & nonempirical==0
bysort year: egen transp_share_quant = mean(transp) if bd==0 & analysis==5|bd==0 & analysis==2
bysort year: egen transp_share_jets = mean(transp) if bd==0 & jets==1
lab var transp_share_bdps "Share of fully transparent BDPS articles, by year"
lab var transp_share_ps "Share of fully transparent non-BD PS articles, by year"
lab var bdps_n "Number of BDPS observations per year"

tw(connected transp_share_empirical year)(connected transp_share_quant year)(connected transp_share_jets year), xline(2010)  xline(2014) scheme(plotplain)  legend(lab(1 "All empirical articles") lab(2 "Quant./mixed methods articles") lab(3 "Articles in JETS journals")) xlabel(2008(1)2019, angle(45))  xtitle("") name(ps_connected) ylabel(0(.2)1)

tw(lfitci transp year if nonempirical==0 & bd==0)(lfitci transp year if analysis==5 & bd==0|analysis==2 & bd==0)(lfitci transp year if jets==1), xline(2010)  xline(2014) scheme(plotplain)  legend(lab(2 "All empirical articles") lab(3 "Quant./mixed methods articles") lab(4 "Articles in JETS journals")) xlabel(2008(1)2019, angle(45)) ytitle("")  xtitle("") name(ps_lfitci) ylabel(0(.2)1)

graph combine ps_connected ps_lfitci, col(1)



***** Figure 6: BDPS vs quant. control group; JETS and non-JETS
tw (qfitci transp year if bd==1)(qfitci transp year if bd==0 & quant ==1), ylabel(0(.2)1)  xlabel(2008(1)2019, angle(45)) ytitle("") legend(lab(2 "BDPS") lab(3 "Non-BDPS (quant.)")) scheme(plotplain) xtitle("") name(fig6_a)

tw (qfitci transp year if bd==1)(qfitci transp year if bd==0 & quant ==1 & jets==0)(qfitci transp year if bd==0 & quant ==1 & jets==1), ylabel(0(.2)1)  xlabel(2008(1)2019, angle(45)) ytitle("") legend(lab(2 "BDPS") lab(3 "Non-BDPS, non-JETS (quant.)") lab(4 "Non-BDPS, JETS (quant.)")) scheme(plotplain) xtitle("") name(fig6_b)

graph combine fig6_a fig6_b, col(1)



**** Table 3
logit transp bd year /* Model 1 */
outreg using table, replace 
logit transp bd year , cl(journal) /* clustering on journals; Model 2 */
outreg using table, merge
logit transp i.bd##c.year , cl(journal) /* checking if difference is equal across time */
outreg using table, merge
logit transp bd ib2019.year , cl(journal) /* year as dummy set */
outreg using table, merge
logit transp bd jets year , cl(journal) /* adding control for JETS; Model 3*/
outreg using table, merge
logit transp bd year if nonempirical==0,  cl(journal) /* empirical articles only; Model 4 */
outreg using table, merge
logit transp bd year if quant==1, cl(journal) /* pure quantitative articles only; Model 5 */
outreg using table, merge
cem  journal (scott) year (#12) ra (#2) if quant==1, treatment(bd) /*coarsened exact matching */
logit transp bd [iweight=cem_weights]
outreg using table, merge /* Model 6*/




*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------
*
*				ONLINE SUPPLEMENTAL MATERIAL
*
*-------------------------------------------------------------------------------
*-------------------------------------------------------------------------------


** D.4 Reliability: Mean transparency scores, by dataset and RAs
ttest transp, by(ra) /* overall */
ttest transp if bd==1, by(ra) /* BDPS group */
ttest transp if bd==0, by(ra) /* Baseline group (non-BD) */


** E.1 Publication outlets for BDPS articles, by PS – non-PS journal
bysort pswos: tab journal 


** E.2 Descriptive statistics 
sum transp transp_code transp_data ra psw jets
bysort bd: sum transp transp_code transp_data ra psw jets



